From: Ian Jackson Date: Mon, 15 Jun 2015 15:18:38 +0000 (+0100) Subject: xl: Do not ignore unparseable PCI BDFs X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2763 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=d43dea81f9135fe26e4de254ecac38a9c773ddf2;p=xen.git xl: Do not ignore unparseable PCI BDFs If xlu_pci_parse_bdf fails, abandon the domain creation, rather than blundering on. Signed-off-by: Ian Jackson CC: Andrew Cooper Acked-by: Wei Liu --- v2: Print the offending supposed-BDF too. --- diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index a08c264f88..5ab4e16472 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1945,8 +1945,14 @@ skip_vfb: pcidev->power_mgmt = pci_power_mgmt; pcidev->permissive = pci_permissive; pcidev->seize = pci_seize; - if (!xlu_pci_parse_bdf(config, pcidev, buf)) - d_config->num_pcidevs++; + e = xlu_pci_parse_bdf(config, pcidev, buf); + if (e) { + fprintf(stderr, + "unable to parse PCI BDF `%s' for passthrough\n", + buf); + exit(-e); + } + d_config->num_pcidevs++; } if (d_config->num_pcidevs && c_info->type == LIBXL_DOMAIN_TYPE_PV) libxl_defbool_set(&b_info->u.pv.e820_host, true);